 <!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <th:block th:include="include :: header('选择企业')" />
    <link href="../static/css/workboard.css" th:href="@{/css/workboard.css}" rel="stylesheet"/>
</head>

<body>
    <div class="container-div">
        <div class="row">
            <div class="col-sm-12" style="background: #fff;border-radius: 6px;width: 100%;">
                <form id="selectEnter-formId">
                    <div class="select-list" style="border-bottom: 1px solid #ddd;">
                        <ul>
                            <li>
                                                                                            企业名称： <input name="companyName" type="text">
                            </li>
                            <li>
                                <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search('selectEnter-formId','selectEnter')"><i class="fa fa-search"></i>&nbsp;搜索</a>
                                <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset('selectEnter-formId','selectEnter')"><i class="fa fa-refresh"></i>&nbsp;重置</a>
                            </li>
                        </ul>
                    </div>
                </form>
                <div class="tabsbody-item">
					<div class="col-sm-12 select-table table-striped">
						<table id="selectEnter"></table>
					</div>
				</div>
            </div>
        </div>
    </div>
    <th:block th:include="include :: footer" />
    <script th:inline="javascript"> 
    var prefix = ctx+"integrityInformationAdd/enterprisesBehavior";
    var companyGuid = "";
    var organCode = "";
    $(function() {
            	var options = {
     			showSearch:false,
               	showRefresh:false,
               	showToggle:false,
               	showColumns:false,
               	id:'selectEnter',		
               	url: prefix + "/selectEnterTableList",
               	modalName: "选择企业",
                columns: [
            	{
                	field : 'select',
                	title : '选择',
                	radio:  true
                }, 
                {
                    field: 'id',
                    title: '序号',
				    formatter: function (value, row, index) {
						   return index + 1;
					}
                },
                {
                    field : 'guid', 
                    title : '标识符',
					visible: false
                },
                {
                    field : 'companyName', 
                    title : '企业名称'
                },
                {
                    field : 'organCode', 
                    title : '组织机构代码/统一社会信用代码'
                },
                {
                    field : 'address', 
                    title : '营业地址'
                }]
            };
            	$.table.init(options);
            	$('#selectEnter').on('check.bs.table', function (e, arg1, arg2) {
            		companyGuid = arg1.guid;
            		organCode = arg1.organCode;
            	})
    });
    
		  //确定回调 
		    function submitHandler() {
		    	var parent = window.parent;
				if($.common.isEmpty(companyGuid)){
		    		$.modal.msgError("请选择一条数据");
		    		return;
		    	}
		    	parent.enter(companyGuid,organCode);
		    	$.modal.close();
		    }
    </script>
</body>

</html>